package zy1204;

import java.util.Scanner;

public class zy2 {
    public static void main(String[] args) throws Exception {
        System.out.println("请输入第一个数字");
        Scanner s = new Scanner(System.in);
        int num3 = 0;
        try {
            int num1 = s.nextInt();
            num3+=num1;
        } catch (Exception e) {
            throw new Exception("输入类型异常！！！");
        }
        System.out.println("请输入第二个数字");
        try {
            int num2 = s.nextInt();
            num3+=num2;
        } catch (Exception e) {
            throw new Exception("输入类型异常！！！");
        }
        System.out.println("两数之和为："+num3);
    }
}
